
import numpy as np
import matplotlib.pyplot as plt
n = 5
A = np.zeros((n,n))
for i in range(n):
    for j in range(n):
        if i != j : A[i,j]=1
#A = np.array([ [3,1,0], [1,3,1],[0,1,3] ])
print('A: \n{}'.format(A))
a, b = np.linalg.eig(A)
print('特征值：{}'.format(a))
print('特征向量：', b)